package vashion.azeroth.back.controller.account;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;

import vashion.azeroth.core.manager.personal.tran.PersonalVAccountManager;
import vashion.azeroth.core.personal.tran.pojo.PersonalVAccount;
import vashion.azeroth.core.service.base.BaseService;

@Controller
@RequestMapping("/back/account")
public class AccountController {

	@Autowired
	private PersonalVAccountManager accountManager;
	
    @RequestMapping("queryAccounts.htm")
    public String getDisburseList(Model model, @ModelAttribute("PersonalVAccount") PersonalVAccount account) {
    	
		int totalCount = accountManager.findCnt(account);
		BaseService page = new BaseService();
		page.initPages(account, totalCount);
		
		List<PersonalVAccount> accounts = accountManager.find(account);
		
		
		model.addAttribute("accounts", accounts);
		model.addAttribute("account", account);
		model.addAttribute("page", page);

        return "/account/accountList";
    }
    
}
